package com.qf.util;

import org.apache.curator.RetryPolicy;
import org.apache.curator.ensemble.fixed.FixedEnsembleProvider;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.CuratorFrameworkFactory.Builder;
import org.apache.curator.retry.ExponentialBackoffRetry;
import org.junit.Test;

/**
 * @author jbx
 * @package_name com.qf.util
 * @create_date 2020/10/27 18:57
 */
public class ZkUtil {
    public static CuratorFramework cf(){
        RetryPolicy retryPolicy = new ExponentialBackoffRetry(3000, 2);
        CuratorFrameworkFactory.Builder curatorFrameworkFactoryBuilder;
        CuratorFramework cf =
                CuratorFrameworkFactory.builder().
                        connectString("192.168.241.102:2181,192.168.241.102:2182,192.168.241.102:2183").
                        retryPolicy(retryPolicy).build();
        cf.start();
        return cf;
    }
}
